﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Luminji.Core.Safe;


namespace Luminji.ExamWeb.Aspx
{
    public partial class Test1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            //EncryptFile(@"c:\temp.txt", @"c:\tempcm.txt", "123");
            //DecryptFile(@"c:\tempcm.txt", @"c:\tempm.txt", "123");
            RijndaelFileHelper rf = new RijndaelFileHelper();
            rf.EncryptFile(@"c:\temp.txt", @"c:\tempcm.txt", "123");
            rf.DecryptFile(@"c:\tempcm.txt", @"c:\tempm.txt", "123");
            string re = rf.EncryptString("Data Source=192.168.0.192;Initial Catalog=wangyuanban;User Id=sa;Password=tongkao2008;", "huzhonghua123");
            Response.Write(re);
            Response.Write("</br>");
            Response.Write(rf.DecryptString(re, "huzhonghua123"));

            Response.Write(ConfigurationManager.AppSettings["ExamConn"]);
            Response.Write("</br>");
            //Response.Write(rf.DecryptString(ConfigurationManager.AppSettings["ExamConn"], "xxx"));
        }
        
        
    }
}